package com.nononsenseapps.feeder.net.obs


import com.gitee.wsl.jvm.net.server.HttpCallHandlerFactory
import com.gitee.wsl.jvm.net.server.IHTTPSession
import com.gitee.wsl.struct.router.CallHandlerFactory

class IndexHandler {
    class Get : ObsDefaultHandler() {
        override val bodyMineType: String
            get() = "application/json"

        override fun getText(session: IHTTPSession): String {
            return """{
                    "ok": "OK",
                    "versions": {
                      "obsidian": "feedin",
                      "self": "0.1"
                    },
                    "service": "'Feedin Local REST API",
                    "authenticated": true
                  }"""
        }

        companion object{
            val Factory = HttpCallHandlerFactory{Get()}
        }
    }
}
